<template>
    <div>
        <!--<adjudication-form :form="form.adjudicationList[0]"
                           v-if="form.adjudicationList.length ==1"></adjudication-form>-->

        <el-collapse class="collapseList" v-model="activeNames" style="margin-left: 5%" accordion>
            <div v-for="adjudication in form.adjudicationList">
                <el-collapse-item :title="adjudication.creditNature" :name="adjudication.creditNature">
                    <adjudication-form :form="adjudication"></adjudication-form>
                </el-collapse-item>
            </div>
        </el-collapse>

        <el-form ref="form" :model="form" label-width="150px" :label-position="labelPosition" style="margin-left:5%">
            <!--<el-form-item label="裁定上传人 :">
                <span>{{form.thirdReceiverName}}</span>
            </el-form-item>
            <el-form-item label="裁定上传时间 :">
                <span>{{form.thirdTime}}</span>
            </el-form-item>-->
            <el-form-item label="法院裁判说明 :">
                <span>{{form.checkedNote}}</span>
            </el-form-item>
           <!-- <el-form-item label="法院裁判文书 :">
            </el-form-item>-->
        </el-form>
       <!-- <div style="width: 100%; margin-top: 5%;margin-left:5%">
        <el-table
                :data="fileList"
                border
                @cell-click="downloadFile"
                style="width: 100%">
            <el-table-column
                    prop="name"
                    label="文书">
            </el-table-column>
            <el-table-column
                    prop="updateDate"
                    label="上传时间"
                    width="105px">
            </el-table-column>
        </el-table>
    </div>-->
        <span style="margin-top: 10%; width: 100%;color: red; text-align: center">{{form.specialNote}}</span>
    </div>
</template>

<script>
    import AdjudicationForm from './adjudication-form.vue'
    import util from 'assets/js/util.js'
    import conf from 'assets/js/conf.js'

    export default {
        data() {
            return {
                fileList: [],
                ccdList:[],
                activeNames: [],
                labelPosition: 'left'
            }
        },
        props: [
            'form'
        ],
        mounted() {
            const _self = this;
            util.ajax({
                url: `/file/getFileList`,
                params: {eids: _self.form.checkedFileids},
                success: function (data) {
                    data.data.forEach(_file => _self.fileList.push({
                        name: _file.name,
                        id: _file.id
                    }));
                },
            });
        },
        methods: {
            downloadFile: function (row, column, cell, event) {
                window.open(conf.baseUrl + '/file/get/'+ row.id + '?type=1')
            },
        },
        components: {
            AdjudicationForm
        }
    }
</script>

<style scoped>
    span {
        float: right;
        margin-right: 20%;
    }

    .el-form-item {
        margin-bottom: 10px;
    }
</style>
